package persistence.appeloffre;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import persistence.produitcatalogue.ProduitCatalogue;

@Entity
@Table(name = "APPEL_OFFRE" )
public class AppelOffre {
	
	private int id;
	
	private int qte;
	
	private Date date;
	
	private int validation;
	
	private ProduitCatalogue produit;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name="APPEL_OFFRE_ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name="QTE", nullable=false)
	public int getQte() {
		return qte;
	}

	public void setQte(int qte) {
		this.qte = qte;
	}

	@Column(name="DATE", nullable=false)
	@Temporal(value=TemporalType.DATE)
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name="VALIDATION", nullable=false)
	public int getValidation() {
		return validation;
	}

	public void setValidation(int validation) {
		this.validation = validation;
	}

	@OneToOne
	@JoinColumn(name="PRODUIT_CATALOGUE_ID")
	public ProduitCatalogue getProduit() {
		return produit;
	}

	public void setProduit(ProduitCatalogue produit) {
		this.produit = produit;
	}

}
